package com.ljh.mybatis.controller;

import com.ljh.mybatis.entity.Teacher;
import com.ljh.mybatis.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @auth 刘佳浩
 * @create 2020-11-18-22:19
 */
@RestController
public class TeacherController {
    @Autowired
    private TeacherService teacherService;
    //一对多
    @GetMapping("getTeaStu/{id}")
    public List<Teacher> getTeaStu(@PathVariable Integer id){
        return teacherService.getTeaStu(id);
    }
}
